<?php

namespace App\Library\TencentMap;


class BaseLibrary
{

    private static array $instance = [];

    protected array $config;

    public static function getInstance(array $config = [])
    {
        if(! isset(self::$instance[static::class])){
            $instance = new static($config);
            if(method_exists($instance, 'init')){
                $instance->init();
            }
            self::$instance[static::class] = $instance;
        }
        return self::$instance[static::class];
    }

    private function __construct($config)
    {
        $this->config = $config;
    }

}